package models;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import utils.dict.Dicts;
import utils.dict.Element;

/**
 * 用户属性模型
 * 
 * @author ultrafrog
 * @version 1.0, 2014-11-11
 * @since 1.0
 */
@Entity
@Table(name = "uwx_user_prop")
public class UserProp extends Model {

	/** 关注标识 */
	@Column(name = "dc_subscribe")
	public String subscribe;
	
	/** 昵称 */
	@Column(name = "vc_nickname")
	public String nickname;
	
	/** 性别 */
	@Column(name = "dc_sex")
	public String sex;
	
	/** 国家 */
	@Column(name = "vc_country")
	public String country;
	
	/** 省份 */
	@Column(name = "vc_province")
	public String province;
	
	/** 城市 */
	@Column(name = "vc_city")
	public String city;
	
	/** 语言 */
	@Column(name = "vc_language")
	public String language;
	
	/** 头像 */
	@Column(name = "vc_head_img_url")
	public String headImgUrl;
	
	/** 关注时间 */
	@Column(name = "dt_subscribe_time")
	public Date subscribeTime;
	
	/** 唯一标识 */
	@Column(name = "vc_union_id")
	public String unionId;
	
	/** 用户 */
	@Column(name = "fk_user")
	public String user;
	
	/**
	 * @return
	 */
	public String getSubscribeName() {
		return Dicts.name(subscribe, Subscribe.class);
	}
	
	/**
	 * @return
	 */
	public String getSexName() {
		return Dicts.name(sex, Sex.class);
	}
	
	/**
	 * 关注标识
	 * 
	 * @author ultrafrog
	 * @version 1.0, 2014-11-11
	 * @since 1.0
	 */
	public static class Subscribe {
		
		@Element("关注")
		public static final String SUBSCRIBED	= "1";
		
		@Element("未关注")
		public static final String UNSUBSCRIBE	= "0";
	}
	
	/**
	 * 性别
	 * 
	 * @author ultrafrog
	 * @version 1.0, 2014-11-11
	 * @since 1.0
	 */
	public static class Sex {
		
		@Element("男")
		public static final String MALE		= "1";
		
		@Element("女")
		public static final String FEMALE	= "2";
	}
}
